<?php
namespace app\common\controller;
use \think\Db;
use think\Controller;
use \think\Request;
use \think\Hook;
use \think\Loader;
class DirectoryPageBase extends Controller
{
	public function _initialize()
    {
	
		$this->request=Request::instance();
		//类的类别
		$this->DoType=$this->request->get('DoType');
		//方法
        $this->DoMethod=$this->request->get('DoMethod');
		//类名
		$this->HttpHandlerName=$this->request->get('HttpHandlerName');
        if($this->DoType=="Entities_Init") {
            if(empty($this->HttpHandlerName)){
                $this->HttpHandlerName="BP.WF.HttpHandler.WF_Comm";
                $this->DoMethod=$this->DoType;
            }
        }
        if($this->DoType="WebUser_Init")
        {
            if(empty($this->HttpHandlerName)){
                $this->HttpHandlerName="BP.WF.HttpHandler.WF_Comm";
                $this->DoMethod=$this->DoType;
            }
        }
		//在php语言中将.NET或者JAVA的类名中的'.'换成'\'
		$this->HttpHandlerName=str_replace(".","\\",$this->HttpHandlerName);
		//流程号
		$this->FK_Flow=$this->request->get('FK_Flow');

		$this->EnsName=$this->request->get("EnsName");
        $this->Paras=$this->request->get("Paras");
	}

	//反射方法
	public function DoMethod(){
	    //$para[]
	    $result=	Hook::exec($this->HttpHandlerName,$this->DoMethod,$this);
	    echo $result;
	}
}
